import SendGQL from "@/api/SendGQL";

//寺庙
const ListTemple = `
  query ListTemple ( $name: String , $perPage: Int64!, $page: Int64!) {
    listTemple (name: $name , perPage: $perPage, page: $page) {
    count
      list{
        createTime
        department
        id
        name
        remarks
        sects
        stationName
        templeimg
        township
        police
      }
    }
  }
`;

export const listTemple = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListTemple,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//id查询人员列表

const Person = `
  query Person ( $id: String) {
    person (id: $id)  {
      birth
      certificate
      classify
      createTime
      crime
      degree
      disciplined
      disciplinedTime
      dratSang
      endTime
      gender
      id
      identity
      img
      legalName
      name
      nation
      native
      number
      occupation
      performance
      phone
      police
      post
      profession
      religious
      remarks
      responsibility
      sects
      shrine
      social {
        appellations
        occupation
        sName
      }
      teacher
      telephone
      templePosition
      templeTime
      train
      usedName
    }
  }
`;


export const person = (id) => {
  return SendGQL({
    query: Person,
    variables: {
      id
    },
  });
};

//人员列表

const ListPerson = `
  query ListPerson ( $name: String,$classify: String , $perPage: Int64!, $page: Int64!) {
    listPerson (name: $name , classify: $classify , perPage: $perPage, page: $page) {
    count
    list{
      birth
      certificate
      classify
      createTime
      crime
      degree
      disciplined
      disciplinedTime
      dratSang
      endTime
      gender
      id
      identity
      img
      legalName
      name
      nation
      native
      number
      occupation
      performance
      phone
      police
      post
      profession
      religious
      remarks
      responsibility
      sects
      shrine
      social{
      appellations
      occupation
      sName
    }
      teacher
      telephone
      templePosition
      templeTime
      train
      usedName
    }
    }
  }
`;


export const listPerson = (params) => {
  const { name, classify, perPage, page } = params;
  return SendGQL({
    query: ListPerson,
    variables: {
      name,
      classify,
      perPage,
      page,
    },
  });
};

//线索列表
const ListClue = `
  query ListClue ( $departmentTime: String, $perPage: Int64!, $page: Int64! , $clueName: String ,$applicationDepartment: String ) {
    listClue (departmentTime: $departmentTime ,  perPage: $perPage, page: $page,clueName: $clueName,applicationDepartment: $applicationDepartment) {
    count
      list{
        applicationDepartment
        armed
        class
        clueName
        createTime
        declare
        departmentTime
        id
        multiple
        stationName
        police
      }
    }
  }
`;


export const listClue = (params) => {
  const { departmentTime, perPage, page, clueName, applicationDepartment } = params;
  return SendGQL({
    query: ListClue,
    variables: {
      departmentTime,
      perPage,
      page,
      clueName,
      applicationDepartment
    },
  });
};

//涉案物品列表
const ListInvolved = `
  query ListInvolved ( $name: String, $perPage: Int64!, $page: Int64! ) {
    listInvolved (name: $name ,  perPage: $perPage, page: $page) {
    count
      list{
        ammunition
        class
        createTime
        department
        id
        img
        name
        number
        stationName
        user
        police
      }
    }
  }
`;


export const listInvolved = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListInvolved,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//涉枪涉爆重点人员列表
const ListPersonnel = `
  query ListPersonnel  ( $name: String, $perPage: Int64!, $page: Int64! ) {
    listPersonnel  (name: $name, perPage: $perPage, page: $page) {
    count
      list{
        caseName
        casePlace
        caseTime
        class
        createTime
        id
        img
        name
        numberId
        remarks
        stationName
        police
      }
    }
  }
`;


export const listPersonnel = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListPersonnel,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//涉枪涉爆案件列表
const ListGunInvolved = `
  query ListGunInvolved  ( $name: String, $perPage: Int64!, $page: Int64! ) {
    listGunInvolved  (name: $name , perPage: $perPage, page: $page) {
    count
      list{
        casePlace
        caseTime
        class
        createTime
        id
        name
        responsible
        stationName
        police
      }
    }
  }
`;


export const listGunInvolved = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListGunInvolved,
    variables: {

      name,
      perPage,
      page,
    },
  });
};


//事故
const GetAccident = `
  query Accident ($id: String) {
    accident ( id: $id) {
        companyId
        companyName
        createTime
        filingTime
        fine
        id
        img
        name
        preventFine
        remarks
        status
        police
      }
  }
`;

export const getAccident = (id) => {
  return SendGQL({
    query: GetAccident,
    variables: {
      id,
    },
  });
};

//车辆列表查询
const ListCar = `
  query ListCar ($name: String, $belong:String, $perPage: Int64!, $page: Int64!) {
    listCar (name: $name,  belong:$belong, perPage: $perPage, page: $page) {
      count
      list{
      belong
      cardId
      class
      color
      createTime
      id
      img
      licensePlate
      model
      name
      remarks
      stationName
      police
      }
    }
  }
`;

export const listCar = (params) => {
  const { name, belong, perPage, page } = params;
  return SendGQL({
    query: ListCar,
    variables: {
      name,
      belong,
      perPage,
      page
    },
  });

};

//佛寺活动列表查询
const ListActivity = `
  query ListActivity (  $page: Int64! , $belong : String , $name : String , $perPage: Int64!,) {
    listActivity ( page : $page , belong: $belong ,  name: $name, perPage: $perPage) {
      count
      list{
        activityContent
        approval
        belong
        createTime
        hostInfo
        id
        monkInfo
        name
        personInfo
        place
        police
        remarks
        routine
        state
        stationName
        time
        type
      }
    }
  }
`;

export const listActivity = (params) => {
  const { name, belong, perPage, page } = params;
  return SendGQL({
    query: ListActivity,
    variables: {
      belong,
      name,
      perPage,
      page
    },
  });
};

//僧人活动人员列表查询
const ListMonk = `
  query ListMonk ($name: String,  $perPage: Int64!, $page: Int64!) {
    listMonk(name: $name, perPage: $perPage, page: $page) {
      count
      list{
        address
        createTime
        gender
        id
        img
        name
        nation
        number
        post
        remarks
        stationName
        temple
        police
      }
    }
  }
`;

export const listMonk = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListMonk,
    variables: {
      name,
      perPage,
      page
    },
  });
};

//治安重点人员列表查询
const ListSuspects = `
  query ListSuspects ($name: String,  $perPage: Int64!, $page: Int64!) {
    listSuspects (name: $name, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        gender
        id
        idcard
        img
        kind
        label
        name
        nation
        occupation
        police
        stationName
      }
    }
  }
`;

export const listSuspects = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListSuspects,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//刑嫌人员列表查询
const ListSecurity = `
  query ListSecurity ($name: String,  $perPage: Int64!, $page: Int64!) {
    listSecurity (name: $name, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        gender
        id
        idcard
        img
        kind
        label
        name
        nation
        occupation
        police
        stationName
      }
    }
  }
`;

export const listSecurity = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListSecurity,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//出境回流人员列表查询
const ListOutbound = `
  query ListOutbound ($name: String,  $perPage: Int64!, $page: Int64!) {
    listOutbound (name: $name, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        ctime
        entrymode
        id
        idcard
        img
        mode
        name
        police
        rtime
        stationName
      }
    }
  }
`;

export const listOutbound = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListOutbound,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//房屋信息列表查询
const ListHouse = `
  query ListHouse ($temple: String , $perPage: Int64!, $page: Int64!) {
    listHouse (temple:$temple , perPage: $perPage, page: $page) {
      count
      list{
        createTime
        id
        img
        remarks
        resident
        residentnum
        stationName
        temple
        templeid
        police
      }
    }
  }
`;

export const listHouse = (params) => {
  const { temple, perPage, page } = params;
  return SendGQL({
    query: ListHouse,
    variables: {
      temple,
      perPage,
      page,
    },
  });
};

//方案列表查询
const ListPlan = `
  query ListPlan ($name: String,  $perPage: Int64!, $page: Int64!) {
    listPlan (name: $name, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        id
        name
        remarks
        stationName
        status
        url
        police
      }
    }
  }
`;

export const listPlan = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListPlan,
    variables: {
      name,
      perPage,
      page,
    },
  });
};

//单位控制列表查询
const ListBusiness = `
  query ListBusiness ($name: String,  $perPage: Int64!, $page: Int64!, $status: Int, $classify: String) {
    listBusiness (name: $name, perPage: $perPage, page: $page, status: $status, classify: $classify) {
      count
      list{
        classify
        createTime
        id
        name
        remarks
        stationName
        status
        url
        police
      }
    }
  }
`;

export const listBusiness = (params) => {
  const { classify, perPage, page } = params;
  return SendGQL({
    query: ListBusiness,
    variables: {
      classify,
      perPage,
      page,
    },
  });
};

//重要点位列表查询
const ListPoints = `
  query ListPoints ($name: String,  $perPage: Int64!, $page: Int64!, $category: String) {
    listPoints (name: $name, perPage: $perPage, page: $page, category: $category) {
      count
      list{
        category
        createTime
        id
        img_url
        name
        remarks
        stationName
        police
      }
    }
  }
`;

export const listPoints = (params) => {
  const { name, perPage, page, category } = params;
  return SendGQL({
    query: ListPoints,
    variables: {
      name,
      perPage,
      page,
      category,
    },
  });
};



//矛盾纠纷列表查询
const ListContradiction = `
  query ListContradiction ($name: String,  $perPage: Int64!, $page: Int64!) {
    listContradiction (name: $name, perPage: $perPage, page: $page) {
      count
      list{
        anticipation
        createTime
        details
        id
        involved
        materials
        name
        place
        report
        stationName
        police
      }
    }
  }
`;

export const listContradiction = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListContradiction,
    variables: {
      name,
      perPage,
      page
    },
  });
};

//涉案物品列表查询information
const ListInformation = `
  query ListInformation ($name: String,$createTime:Int64, mold:String, $perPage: Int64!, $page: Int64!) {
    listInformation (name: $name, createTime: $createTime,mold:$mold, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        id
        mold
        name
        person
        place
        stationName
        police
      }
    }
  }
`;

export const listInformation = (params) => {
  const { name, createTime, mold, perPage, page } = params;
  return SendGQL({
    query: ListInformation,
    variables: {
      name,
      createTime,
      mold,
      perPage,
      page
    },
  });
};

//政保人员列表查询SecPersonnel 
const ListSecPersonnel = `
  query ListSecPersonnel ($name: String,$perPage: Int64!, $page: Int64!) {
    listSecPersonnel (name: $name, perPage: $perPage, page: $page) {
      count
      list{
        createTime
        gender
        id
        idcard
        img
        kind
        label
        name
        nation
        occupation
        remarks
        occupation
        police
      }
    }
  }
`;

export const listSecPersonnel = (params) => {
  const { name, perPage, page } = params;
  return SendGQL({
    query: ListSecPersonnel,
    variables: {
      name,
      perPage,
      page
    },
  });
};

//管理员列表查询 
const ListManager = `
  query ListManager ($account: String, status: $managerStatusEnum, $perPage: Int64!, $page: Int64!) {
    listManager (account: $account, status: $status, perPage: $perPage, page: $page) {
      count
      list{
        account
        avatarUrl
        id
        nickname
        root
        status
        updateTime
        police
      }
    }
  }
`;

export const listManager = (params) => {
  const { name, status, perPage, page } = params;
  return SendGQL({
    query: ListManager,
    variables: {
      name,
      status,
      perPage,
      page
    },
  });
};

//会员列表查询 
const ListMember = `
  query ListMember ($account: String, $perPage: Int64!, $page: Int64!) {
    listMember (account: $account, perPage: $perPage, page: $page) {
      count
      list{
        account
        avatarUrl
        belong
        createTime
        id
        manageTemple
        name
        root
        stationName
        police
      }
    }
  }
`;

export const listMember = (params) => {
  const { account, perPage, page } = params;
  return SendGQL({
    query: ListMember,
    variables: {
      account,
      perPage,
      page
    },
  });
};